package com.econ.powercloud.ems.common.enums;

/**
 * @ Description:
 * @ Author：hgp
 * @ Create:2022-05-25-8:41
 */
public enum TableType implements EnumMethod {
    YC(1,"遥测"),
    YX(2,"遥信"),
    YK(3,"遥控"),
    YT(4,"遥调"),
    CAL(5,"计算"),
    ;

    private Integer code;
    private String desc;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }


    TableType(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static TableType fromCode(int code){
        for(TableType types: TableType.values()){
            if(types.getCode() == code){
                return types;
            }
        }
        return TableType.YK;
    }
}
